Skip to content

Added Auth fields#147

Closed
pielonet wants to merge 3 commits intonextcloud:masterfrom
arawa:master
Closed

Added Auth fields#147
pielonet wants to merge 3 commits intonextcloud:masterfrom
arawa:master

Conversation

@pielonet
Copy link
Copy Markdown

Hi,

I added autentication fields to nextcloud/external.

These authentication fields allow opening external sites protected by a login/password form.

It uses an ajax post request made to an authentication url. Once the authentication is successful and the session cookie has been set, the iframe src attribute is changed to match the external site final url.

Since most of the time the ajax request is performed against an other domain than Nextcloud's one we are confronted to cross sites control restrictions. Thus it is necessary to add Access-Control-Allow-xxxx headers to the web server hosting the external site. The most common necessary headers are those :
Access-Control-Allow-Origin : "https://external.site.domain"
Access-Control-Allow-Methods : "GET, POST, OPTIONS"
Access-Control-Allow-Credentials: "true"
Access-Control-Allow-Headers: "Authorization, Content-Type"

The fourth field I added is there for supplementary headers sent with the ajax request that might be required by the login form.

I successfully used these auth fields to authenticate against Kibana free edition with x-pack security enabled.

Thank you for taking my contribution into account.

Best regards,

Thierry

@pielonet
Copy link
Copy Markdown
Author

pielonet commented Oct 3, 2019

Hi,
Anybody out there ?
Still waiting for a review !
Thanks,
Thierry

Thierry Kauffmann and others added 3 commits October 3, 2019 11:46
Signed-off-by: Thierry Kauffmann <tkauffmann@arawa.fr>
Signed-off-by: Thierry Kauffmann <tkauffmann@arawa.fr>
Signed-off-by: Thierry Kauffmann <tkauffmann@arawa.fr>
@DanielLester83
Copy link
Copy Markdown

DanielLester83 commented Oct 3, 2019

I literally just made a middle man PHP page to do a much simpler version of this. Maybe this code can be of some use. It converts "GET" URL variables to "POST" so that {displayname} and hopefully a future {password} can be used to automatically login nextcloud users into other websites. This is obviously much less a complete than what you have done, congratulations.

HTML Code:
usrlogin.php.txt

@pielonet
Copy link
Copy Markdown
Author

pielonet commented Oct 9, 2019

Hi,
@nickvergessen @MariusBluem Can you review ?
Thanks,

@nickvergessen
Copy link
Copy Markdown
Member

Yeah sorry, it's still on my todo, but I have a lot to do lately

Copy link
Copy Markdown

@andrenasturas andrenasturas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not good enough to review all the code, but interested into the feature so I checked what I could.

Comment thread l10n/fr.json
{ "translations": {
"Name" : "Nom",
"URL" : "URL",
"Auth" : "Authorisation",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Auth" : "Authorisation",
"Auth" : "Autorisation",

Or maybe "Authentification" ?

Comment thread l10n/en_GB.json
{ "translations": {
"Name" : "Name",
"URL" : "URL",
"Auth" : "Auth",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Auth" : "Auth",
"Auth" : "Authorization",

For coherence with i18n/en_GB.js

@Crow-Control
Copy link
Copy Markdown

Love the idea of this, but we might want to add a "logout redirect" to the main Nextcloud codebase first (which has been long due anyway), to also enable people to seemlessly log out of an external service on nextcloud logout too.

@nickvergessen nickvergessen removed this from the 💚 Next Major (18) milestone Jul 21, 2022
@nickvergessen
Copy link
Copy Markdown
Member

I don't think this is something we want. You can check if #310 solves your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants